package com.didispace.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.didispace.domain.rqsinfor;
import com.didispace.domain.rqsinforRepository;
import com.didispace.service.AddCaseService;

@Component
public class AddCaseimpl  implements AddCaseService {
	
	
	@Autowired
	rqsinforRepository rqsinforRepository;

	@Override
	public  boolean SaveCase(String RequestMessage,String Url,String MethodName,String RequestName, String AssertContent,String MessageFormat) {
		
		if(RequestMessage==null) {
			RequestMessage=" ";
		}
		if(Url==null) {
			Url=" ";
		}
		if(MethodName==null) {
			MethodName=" ";
		}
		if(RequestName==null) {
			RequestName=" ";
		}
		if(AssertContent==null) {
			AssertContent=" ";
		}
		try {
		rqsinforRepository.save(new rqsinfor(RequestMessage,Url,MethodName,RequestName,AssertContent,MessageFormat));
					return true;
		}catch(Exception e) {
			System.out.println(e.getMessage());
			return false;
		}
	}
	
	
	
	
	
}
